<template>
	<view class="page">
		<v-header title="修改密码" @click-left="$back()"></v-header>
		<view class="layout" :style="{ marginTop: h + 'px' }">
			<view class="editPwdContainer">
				<view class="loginBox">
						<view class="f cell">
				
							<label class="label"> <text class="requierText">*</text>原密码:</label>
							<input class="fl" type="password" v-model="addquery.oldpwd" placeholder="请输入原密码" maxlength="30" />
						</view>
						<view class="f cell">
				
							<label class="label"><text class="requierText">*</text>新密码:</label>
							<input class="fl" type="password" v-model="addquery.newpwd" placeholder="请输入新密码" maxlength="30" />
						</view>
						<view class="f cell">
				
							<label class="label"><text class="requierText">*</text>确认密码:</label>
							<input class="fl" type="password" v-model="addquery.repwd" placeholder="请输入确认密码" maxlength="30" />
						</view>
						
						<view class="cu-btn block round login" @click="saveInfo">确认</view>
					</view>
				
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			h: this.$h,
			addquery: {
				oldpwd: '',
				newpwd: '',
				repwd: '',
				
			},
		};
	},
	methods:{
		saveInfo(){
			let than = this;
			let oldpwd = than.addquery.oldpwd || '';
			let newpwd = than.addquery.newpwd || '';
			let repwd = than.addquery.repwd || '';
			
			if (!oldpwd || oldpwd == '') {
				uni.showToast({
					title: '请输入原密码',
					icon: 'none'
				});
				return false;
			}  else if (!newpwd || newpwd == '') {
				uni.showToast({
					title: '请输入新密码',
					icon: 'none'
				});
				return false;
			} else if (!repwd || repwd == '') {
				uni.showToast({
					title: '请输入确认密码',
					icon: 'none'
				});
				return false;
			} else if (newpwd!==repwd) {
				
					uni.showToast({
						title: '两次密码输入不一致',
						icon: 'none'
					});
					return false;
				
			} else {
				// uni.navigateTo({
				// 	url: '../../views/login/enterpriseInfo'
				// });
			}
		}
	}
};
</script>

<style lang="scss" scoped>
	.editPwdContainer{
		padding-top: 60rpx;
		.loginBox {
				.cell {
					height: 90rpx;
					margin: 0 54rpx 30rpx 54rpx;
					border-bottom: solid 1rpx $bcolor;
					font-size: 32rpx;
		
					.requierText {
						display: inline-block;
						width: 10rpx;
						color: #f43f3b;
						margin-right: 10rpx;
					}
		
					.label {
						width: 160rpx;
						margin-right: 10rpx;
					}
		
					input {
						height: 60rpx;
					}
				}
		
				.login {
					font-size: 32rpx;
					margin: 60rpx 54rpx 30rpx 54rpx;
					height: 96rpx;
					color: #fff;
					background-image: linear-gradient(to left, $color, #00aaff);
				}
			}
		
	}
</style>
